# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=p2pool
pkgver=3.2
_commit=92827035e07ff15da6b7645a332f3e59aa0ab1c4
pkgrel=1
pkgdesc='Decentralized pool for Monero mining'
arch=('loong64' 'x86_64')
license=('GPL-3.0-or-later')
url="https://github.com/SChernykh/p2pool"
depends=('curl' 'libuv' 'libsodium' 'zeromq')
makedepends=('cmake' 'git')
source=("${pkgname}"::"git+https://github.com/SChernykh/${pkgname}#commit=${_commit}")
b2sums=('SKIP')
options=(!lto)

prepare() {
  cd ${pkgname}
  git submodule init
  git submodule update
  mkdir -p build
}

build() {
  cd ${pkgname}/build
  cmake .. -DCMAKE_BUILD_TYPE=Release
  make -j$(nproc)
}

package() {
  cd ${pkgname}
  install -Dm775 "build/p2pool" -t "${pkgdir}/usr/bin"
}

# vim: ts=2 sw=2 et:
